<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%

String path = request.getContextPath();
	String BasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>川轻化健身房</title>
  <meta name="description" content="Ela Admin - HTML5 Admin Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">



<link href="<%=BasePath%>/static/time/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" href="<%=BasePath%>/staticassets/css/normalize.css">
<link rel="stylesheet" href="<%=BasePath%>/staticassets/css/bootstrap.min.css">
<link rel="stylesheet" href="<%=BasePath%>/static/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="<%=BasePath%>/static/assets/css/themify-icons.css">
<link rel="stylesheet" href="<%=BasePath%>/static/assets/css/style.css">
<link rel="stylesheet" href="<%=BasePath%>/static/vendor/bootstrap/css/bootstrap.css" />
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800' rel='stylesheet' type='text/css'>
<script type="text/javascript"
	src="<%=BasePath%>/static/vendor/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript"
	src="<%=BasePath%>/static/vendor/bootstrap/js/bootstrap.min.js"></script>



</head>

<body>




	<!-- Left Panel -->
	    <!-- Left Panel -->
    <aside id="left-panel" class="left-panel">
        <nav class="navbar ">
            <div id="main-menu" class="main-menu ">
                <ul class="nav navbar-nav">
                    <li class="menu-item "><a href="../admin/index" class="dropdown-toggle"><i
                            class="menu-icon fa fa-home"></i>主页</a></li>
                    <li class="menu-title">会员管理</li>
                    <!-- /.menu-title -->
                    <li class="menu-item"><a href="../admin/member"
                                             class="dropdown-toggle"> <i class="menu-icon  fa fa-search"></i>查看会员信息
                    </a></li>
                    <li class="menu-title">教练管理</li>
                    <!-- /.menu-title -->
                    <li class="menu-item "><a href="../admin/coachs"
                                              class="dropdown-toggle"> <i class="menu-icon fa   fa-users"></i>查看教练信息
                    </a></li>
                    <li class="menu-item active"><a href="../admin/addcoach"
                                             class="dropdown-toggle"> <i
                            class="menu-icon fa  fa-cut (alias)"></i>激活教练账号
                    </a></li>
                    <li class="menu-title">公告信息管理</li>
                    <li class="menu-item "><a href="../admin/notice"
                                                    class="dropdown-toggle"> <i
                            class="menu-icon fa    fa-location-arrow"></i>查看公告信息
                    </a></li>
                    <li class="menu-item "><a href="../admin/addnotice"
                                             class="dropdown-toggle"> <i class="menu-icon fa    fa-align-justify"></i>添加公告信息
                    </a></li>



                </ul>
            </div><!-- /.navbar-collapse -->
        </nav>
    </aside>
    <!-- /#left-panel -->
    <!-- Right Panel -->
    <div id="right-panel" class="right-panel">
        <!-- Header-->
        <header id="header" class="header">
            <div class="top-left">
              <div class="navbar-header">
                   <a class="navbar-brand" href="./"><p style="font-size:30px" >健身房后台管理</p></a>

                   <a id="menuToggle" class="menutoggle"><h4><i class="fa fa-bars fa-lg"></i></h4></a>
                </div>
            </div>
            <div class="top-right">
                <div class="header-menu">
                <div class="header-left">

					</div>
                    <div div class="user-area dropdown float-right">	
                   <span class="text-success"> <%HttpSession name = request.getSession(); %>
                                            <%=name.getAttribute("adminname") %>欢迎你！</span>
                                              </div>


                </div>
            </div>
        </header>
        <div class="content">
            <div class="col-lg-6">
                <div class="card" align="center">

                    <div class="card-body card-block">
                        <form action="#"  method="post" enctype="multipart/form-data" class="form-horizontal">

                            <div class="row form-group">
                                <div class="col col-md-3"><label for="text-input" class=" form-control-label">开通账号</label></div>
                                <div class="col-12 col-md-9"><input type="text" id="text-input" name="text-input"
                                                                    placeholder="请输入账号" class="form-control"></div>
                            </div>

                            <div class="row form-group">
                                <div class="col col-md-3"><label for="password-input" class=" form-control-label">开通密码</label></div>
                                <div class="col-12 col-md-9"><input type="password" id="password-input" name="password-input"
                                                                    placeholder="请输入密码" class="form-control"></div>
                            </div>
                            <div class="input-group-btn">
                                <button type="button"  class="btn btn-primary" onclick="addcoach()">开通账号</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
	</div>

    <script src="<%=BasePath%>/static/assets/js/vendor/jquery-2.1.4.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/popper.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/bootstrap.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/jquery.matchHeight.min.js"></script>
    <script src="<%=BasePath%>/static/assets/js/main.js"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/jquery/jquery-1.8.3.min.js" charset="UTF-8"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
    <script type="text/javascript" src="<%=BasePath%>/static/time/js/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        function addcoach() {
            var username = $("#text-input").val();
            var password = $("#password-input").val();
            console.log(username+":"+password);
            $.ajax({
                url:"../admin/insertCoach",
                data:{
                    phone:username,
                    password:password
                },
                type:"post",
                success:function (data) {
                    if(data.msg=="success"){
                        alert("注册成功");
                    }
                    else
                        alert(data.msg);
                }
            })
        }
    </script>

</body>
</html>
